<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no,minimum-scale=1,maximum-scale=1.0" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>我的资料 - 红高粱</title>
<script type="text/javascript" src="../m/js/jquery.min.js"></script>
<script type="text/javascript" src="../m/js/loginValid.js"></script>
<script type="text/javascript" src="../m/js/user.js"></script>
<style type="text/css">
header{width:100%;background-image:url("../m/images/u_head.png");overflow:hidden;background-size:cover; }
header .avatar{width:45%;margin:0 auto; margin-top:20px; }
header .avatar img{ width:100%}
header .c_pass{float:left;width:35%; margin:5% 3.946% 5.5% 11.23%;}
header .c_pass img{ width:100%}
header .exit{float:left;width:35%;margin:5% 10.23% 5.5% 3.946%; }
header .exit img{ width:100%}
body{ background-image:url("../m/images/c_shop_bg2.png") no-repeat right;}

*{ margin:0; padding:0;}
.clear_both{clear:both;margin-bottom:50px;}
.menu_list a{text-shadow:#5f472d 0px 0px 2px; color:#fff; font-weight:bold; text-decoration: none;}
.menu_list{height:50px;float:left;width:100%;text-align:left;line-height:50px;background:url("../m/images/u_head_list_bg.png") repeat-x;overflow:hidden;margin-bottom:20px;}
.nav_list {float:left;}
.nav_list img{ height:50px;}
.my_order,.my_zl,.my_card{float:left; width:33.0333%; text-align:center; overflow:hidden;}
.my_zl{}
.menu_content{width:96%;text-align:center;margin:0 auto;overflow:hidden;box-shadow: 0px 0px 2px #26282b;background-color:#2b2e31;border:1px solid #272a2d;border-radius:0.3em; color:#686868;}
.menu_content div{line-height:48px;}
input{border:none;font-size:1em; width:200px;background-color:#2b2e31;color:#fff;}
textarea { background-color:#f7f8fa; border:none; padding:10px 0; width:90%;font-size:1em;}
.href_style{text-decoration:none;}
.button{width:96%; margin:0 auto; margin-top:20px;}
.txt{width:28%;text-align:right; float:left;color:#fff;font-size:1em;}
.txt2{width:70%;text-align:left;float:right;}
.border{background:url("../m/images/u_info_list.png") repeat-x;background-position:bottom;overflow:hidden;}
#updateButton{background:url("../m/images/save.png") no-repeat;height:45px;width:100%;background-size: contain;}
#cancel{background:url("../m/images/cancel.png") no-repeat;height:45px;width:47.5%;background-size: contain; float:right;}
</style>
<!-- 
body{ background-image:url("../m/images/bg.png");} 
-->
<script type="text/javascript">
	$(document).ready(function(){
		var userId = '${sessionScope.user.id}';
		loginValid(userId);
		
		//更新信息
		$("#updateButton").click(function(){
			var realName = $('#realName').val();
			var phone = $('#phone').val();
			var address = $('#address').val();
			$.ajax({
				url:"../user/updateUser",
				type:"POST",
				data:{id:userId,realName:realName,phone:phone,address:address},
				dataType:"json",
				success:function(data){
					if(data.ok=='ok'){
						alert(data.msg);
					}else{
						alert('更新失败，请稍后再试。');
						location.reload(true);
					}
				}
			});
		});
		
	});
</script>
</head>
<header>
	<div class="header">
		<div class="avatar"><a href="#"><img src="../m/images/logo.png"></a></div>
		<div class="c_pass"><a href="#"><img id="updatePass" src="../m/images/c_pass.png"></a></div>		
		<div class="exit"><a href="#"><img id="userExit" src="../m/images/exit.png"></a></div>
	</div>
</header>
<body>
    <div style="width:100%;float:left;">
		<div class="menu_list">
			<div class="my_order">
				<a href="javascript:" onclick="location.href='./backend?cid=${loginId}'" class="href_style">我的订单</a>
			</div>
			<div class="nav_list">
				<img src="../m/images/user_list.png">
			</div>
			<div class="my_zl">
				<a href="javascript:location.reload(true);" class="href_style">我的资料</a>
			</div>		
			<div class="nav_list">
				<img src="../m/images/user_list.png">
			</div>
			<div class="my_card">
				<a href="javascript:" onclick="location.href='./userCardNo?cid=${loginId}'" class="href_style">我的代金券</a>
			</div>

		</div>
		<div class="menu_content">
			<div class="border">
				<div  class="txt">代金券金额：</div>
				<div  class="txt2"><input type="text" id="phone" value="${sessionScope.user.phone}" readOnly="true">这里填还有多少钱代金券</input></div>	
			</div>			
			<!-- <div> 
				<div  class="txt">收货地址：</div>					
				<div  class="txt2"><textarea id="address" rows="3">${sessionScope.user.address}</textarea></div>	
			</div>
			 -->		
		</div>

		<div class="button">
				<span><input type="button" id="updateButton" ></span>
				<!-- <span><input type="button" id="cancel"></span> -->
		</div>	
	</div>
</body>
<div class="clear_both"></div>
<%@ include file="footer.jsp" %>
</html>